package dev.ideas.funkyj.sequence;

import org.junit.Test;

import static dev.ideas.funkyj.sequence.Sequence.*;
import static org.junit.Assert.*;

/**
 */
public class Is {

    @Test
    public void t1() {
        assertEquals(
                from(1, 2, 3, 4).where(string.is("1")).first(),
                new Integer(1));

        assertEquals(
                from("1", "2", "3", "4").where(integer.is(even)).asList(),
                from("2", "4").asList());

        //
        //noinspection unchecked
        assertEquals(
                from(1, 2, 3, 4).where(is(string, equal("1"))).first(),
                new Integer(1));

        assertEquals(
                from("1", "2", "3", "4").where(is(integer, even)).asList(),
                from("2", "4").asList());
    }
}
